<template>
  <div class="setting_pay">
    <div class="con">
      <span class="title">支付设置</span>
      <div class="item">
        <span class="tip">电子卡支付密码</span>
        <span class="res" @click="setPassword"> 
          <input
            type="password"
            v-model="dataForm.phoneNumber"
            placeholder="请输入六位密码"
          />
        </span>
      </div>
      <div class="item">
        <span class="tip">原密码</span>
        <span class="res" @click="setPassword"> 
          <input
            type="password"
            v-model="dataForm.old"
            placeholder="请输入原密码"
          />
        </span>
      </div>
      <div class="item">
        <span class="tip">新密码</span>
        <span class="res" @click="setPassword"> 
          <input
            type="password"
            v-model="dataForm.new"
            placeholder="请输入新密码"
          />
        </span>
      </div>
      <div class="item">
        <span class="tip">免密</span
        ><span class="res">
          <van-switch v-model="dataForm.checked" size="20px" />
        </span>
      </div>
    </div>
    <!--
    <van-cell-group>
      <van-field v-model="value" label="文本" placeholder="请输入用户名" />
    </van-cell-group>
    <van-password-input
      :value="value"
      info="密码为 6 位数字"
      :error-info="errorInfo"
      :focused="showKeyboard"
      @focus="showKeyboard = true"
    />
    -->
    <van-number-keyboard
      v-model="value"
      :show="showKeyboard"
      @blur="showKeyboard = false"
    />
  </div>
</template>

<script>
import { mapState, mapGetters, mapActions } from "vuex";
import Vue from "vue";
import { Switch } from "vant";

Vue.use(Switch);
import { PasswordInput, NumberKeyboard } from "vant";

Vue.use(PasswordInput);
Vue.use(NumberKeyboard);
export default {
  head() {
    return {
      title: "我的",
    };
  },
  data() {
    return {
      images: [],
      list: [],
      loading: false, //加载状态
      finished: false, //是否完成加载
      refreshing: false, //是否正在上拉刷新
      value: "123",
      errorInfo: "请输入数字",
      showKeyboard: true,
      checked: true,
      dataForm:{
        password:'',
        new: '',
        old: '',
        checked:true
      }
    };
  },
  components: {
    // PasswordInput: PasswordInput,
  },
  computed: {
    ...mapGetters({
      userInfo: "authen/userInfo",
    }),
    ...mapState({
      // pointInfo: (state) => state.point.pointInfo,
    }),
  },
  mounted() {
    // this.getPointInfo();
  },
  methods: {
    ...mapActions({
      // getPointInfo: "point/getPointInfo",
    }),
    setPassword(){
      console.log(111111111111)
      this.showKeyboard = true;
    },
  },
};
</script>

<style lang="scss">
.setting_pay {
  width: 7.5rem;
  min-height: 100vh;
  background-color: #f5f6f7;
  padding: 0 0.29rem;
  box-sizing: border-box;
  overflow: hidden;

  > .con {
    box-sizing: border-box;
    margin-top: 0.3rem;

    .title {
      font-size: 0.3rem;
      font-weight: bold;
      line-height: 0.3rem;
    }
    .item {
      display: flex;
      justify-content: space-between;
      width: 6.87rem;
      height: 0.87rem;
      background: #ffffff;
      border-radius: 0.15rem;
      padding: 0 .2rem;
      box-sizing: border-box;
      align-items: center;
      font-size: 0.28rem;
      font-weight: border;
      color: #000000;
      margin-top:0.3rem;
      .res {
        input {
          background: none;
          outline: none;
          border: none;
          text-align: right;
        }
      }
    }
  }
}
</style>
